<?php

namespace App\Models;

class AddressModel extends RbhBaseModel
{
    protected $table = 'df_address';

    protected $guarded = [];

    /**
     * 创建收货地址
     * @param $uid
     * @param $request
     * @return mixed
     */
    public static function createAddress($uid, $request): mixed
    {
        return self::create([
            'uid'             => $uid,
            'province'        => $request->input('province'),
            'city'            => $request->input('city'),
            'district'        => $request->input('district'),
            'address'         => $request->input('addr'),
            'name'            => $request->input('name'),
            'mobile'          => $request->input('mobile'),
        ]);
    }
}
